dim xxx

'************
'//This Sub Is called When the script File is loaded
'**********
Sub Event_Load()
	'ssc.AddChat "TestScript Loaded!"
End Sub



'************
'//Bot has logged onto Battle.net  SCGateway is the
'    SCGateway - "useast", "uswest", "asia", etc
'    WCGateway - "Azeroth", "Northrend", etc.
'    Both of the above are passed regardless of product
'****************
Sub Event_LoggedOn(Username, Product, SCGateway, WCGateway)
	'ssc.addChat "(TestScript)Logged Onto" & SCGateway & "/" & WCGateway
End Sub


Sub Event_Usertalk(Username, Flags, Message, Ping)
	
End Sub


'///My semi-Complex On Join Sub
'    Parsed Statstring - Contains the parsed statstring of the user
'    OrigStatString - Contains the unmodifed statstring of the user
'    Clan - WC Clan(If applicable)
'    GreetUser -   If false, then that means the user has already been
'    marked as banned(ban has been sent to que).  You should take advantage
'    Of this to not waste time with the user.  
'    
' //This is a Function(Default return value is always false).  If you set the return
'  value to TRUE ( Event_UserJoins=TRUE) then the greetUser variable will be set
'  to false(bot greets will not be sent, and user will not be checked for 
'  mail/lastseen).
' //Because I have already retrieved Access and Safelisted status, I have passed those
'    as well
'    
'**************
Function Event_UserJoins(Username, Flags, ParsedStatString, OrigStatString, Product, Clan, Ping, Access, safeListed, GreetUser)


End Function


Sub Event_ServerInfo(Message) 


End Sub


Sub Event_ServerError(Message)

End Sub



Sub Event_UserEmote(Username, Flags, Message)

End Sub


Sub Event_WhisperFromUser(Username, Flags, Message)

End Sub


Sub Event_WhisperToUser(Username, Flags, Message)

End Sub


Sub Event_UserLeaves(Username, Flags)

End Sub

Sub Event_FlagUpdate(Username, NewFlags, Ping, Message)

End Sub

Sub Event_UserInChannel(Username, Flags, Message, Ping, Product, OrigStatString)

End Sub

Sub Event_ChannelJoin(ChannelName) ' Bot joins a different Channel
	
End Sub


Sub scTimer_Timer() ' fires when the timer goes off

'//Timer Settings can be modifed with the added ScriptTimer Object
'//ScriptTimer.Enabled=True, ScriptTimer.Interval=1000, etc

End Sub


'************
'//Fires when enter is pressed in the send box
'    ''This is a function.  By default the return value is false.
'      However, if you set the return value to TRUE(Event_PressedEnter=True)
'      Then the text will not be processed by the bot as normal
Function Event_PressedEnter(Text)
	if text="/bob" then Event_PressedEnter=True
End Function

'************
'//FooLOps Command Processor
'    I added a seperate sub for a command processor, called directly by my command 
'    processor.  This sub is called only after triggers have been parsed, and
'    multiple commands have been split.  The Ops Commands(Bans, unbans, or whatever I
'    have in my ops commands sub) have precedence over this.  If they are parsed, 
'    then this sub will never be called.
'
'///Here is how you parse/return the command.  "Command" contains the first word, 
'   the actual command(no trigger).  Rest is the rest of the command
'  (whatever follows, if anything).
'   Set the return value with Event_ParseCommand="Return Message"
'   If the return message is blank, then the bot will consider the command unparsed
'   and continue to search through the rest of the commands list
'   If the return message is a single space ' ', then the bot will consider the command
'   parsed but will not return anything to the que or bot window.
'   Any real return message will either be added directly to the que(you can use 
'   vbCrLfs for multiple lines), or send to the bot window(depending on where the
'   command was called from.
'   All script command processors are processed simultaneosly, so that they will not interfere with eachother.

' It is also important to note that in addition to this, Event_Usertalk or Event_WhisperFromUser can also be called.


Function Event_ParseCommand(Command, Rest, Username, Access, Inbot)
select case command
	case "scriptver"
	   if access<20 then exit function
	   event_parsecommand ="LameBanScript V1 by The-FooL"
        case "aboutscript"
	If access<50 then exit function
	   'Event_ParseCommand="This is a testscript used to demonstrate the command processor"
   case "lameban"
	dim h
	if access<50 then exit function
	event_ParseCommand=" "
	If InStr(1, rest, "*") > 0 Then 'wildcard
        h=ssc.WCChannel(rest)
        For x = 1 To UBound(h)
            If ssc.banAccess(Username,h(x)) Then
                ssc.AddQ "/ban " & h(x) & " LameBan", 3
               'exit function
            Else
                nobancount = nobancount + 1
            End If
        Next 
	If UBound(h) = 0 Then
            Event_parsecommand = "No users found"
        ElseIf nobancount > 0 Then
            Event_ParseCommand = nobancount & " users not banned(due to access or safelist)"
        End If
    Else 'no wildcard
            If ssc.banAccess(Username, rest) Then
	            ssc.AddQ "/ban " & rest & " LameBan ", 3
            Else
                Event_ParseComamnd = "That user has higher access or is safelisted"
            End If
    End If
	case else
	'put as many cases as you need for this scripts commands

end select

End Function

'///When The Script File is Unloaded(Bot Close)
Sub Event_Close()
	
End Sub

